package top.hongthorn.controller;

import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import top.hongthorn.pojo.RegionalEventTwo;
import top.hongthorn.service.RegionalEventTwoService;
import top.hongthorn.util.Result;

import java.util.Map;

/**
 * <p>
 * 地区事件 2 前端控制器
 * </p>
 *
 * @author 泓宇网络科技工作室
 * @since 2023-12-28 00:47:55
 */
@RestController
@RequestMapping("/regionalEventTwo")
@Api(value = "RegionalEventTwoControll",tags = "RegionalEventTwoControll")
public class RegionalEventTwoController {
    @Autowired
    private RegionalEventTwoService service;
    @ApiOperation(value = "添加地区")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "longitude",value = "经度",dataType = "String",paramType = "query",required = true),
        @ApiImplicitParam(name = "latitude",value = "纬度",dataType = "String",paramType = "query",required = true),
        @ApiImplicitParam(name = "site",value = "地点",dataType = "String",paramType = "query",required = true),
        @ApiImplicitParam(name = "subordinate",value = "所属国家",dataType = "String",paramType = "query",required = true),
        @ApiImplicitParam(name = "strategicHierarchy",value = "战略等级",dataType = "Integer",paramType = "query",required = true)
    })
    @RequestMapping(value = "/insert",method = RequestMethod.GET)
    public Result insert(RegionalEventTwo regionalEventTwo){
        return service.insert(regionalEventTwo);
    }
    @ApiOperation(value = "地区数据分页")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "页码", dataType = "Integer", example = "1", required = false),
            @ApiImplicitParam(name = "limit", value = "显示条数", dataType = "Integer", example = "3", required = false),
    })
    @RequestMapping(value = "/selectPage", method = RequestMethod.GET)
    public Map selectPage(Integer page, Integer limit){
        return service.selectPage(page, limit);
    }

    @ApiOperation(value = "修改地区")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "longitude",value = "经度",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "latitude",value = "纬度",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "site",value = "地点",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "subordinate",value = "所属国家",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "strategicHierarchy",value = "战略等级",dataType = "Integer",paramType = "query",required = true)
    })
    @RequestMapping(value = "/updateId",method = RequestMethod.GET)
    public Result updateId(RegionalEventTwo regionalEventTwo){
        return service.updateId(regionalEventTwo);
    }

    @ApiOperation(value = "删除地区")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "地区ID",dataType = "Integer",paramType = "query",required = true)
    })
    @RequestMapping(value = "/deletById",method = RequestMethod.GET)
    public Result deletById(Integer id){
        return service.deletById(id);
    }
}
